package com.qf.air.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.github.pagehelper.PageInfo;
import com.qf.air.entity.Air;
import com.qf.air.vo.ResultVO;

import java.io.IOException;
import java.util.Date;

/**
 * @Author: 维多利加
 * @Date: 2021/3/20 10:52
 */

public interface AirService {

    PageInfo<Air> findByPageAndDistrictId(Integer page, Integer rows, Integer districtId);

    void save(Air air) throws JsonProcessingException;

    void deleteById(Integer id);

    void updateById(Air air);

    /**
     * 从Elasticsearch查询数据
     * @param page
     * @param rows
     * @param districtId
     * @param monitorStation
     * @param startTime
     * @param endTime
     * @return
     */
    ResultVO findByPageAndConditionFromElasticsearch(Integer page, Integer rows, Integer districtId, String monitorStation, Date startTime, Date endTime) throws IOException;

    /**
     * 查询统计PM2.5从0~1~2~3..........等范围的数据条数
     * @return
     */
    Object findEchartsData() throws IOException;
}
